import request from '@/utils/request'

export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}
// 添加部门
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 根据id查询部门详情
export function getDepartmentById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'get'
  })
}

// 根据id查询部门详情
export function updateDepartment(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}

// 根据id删除部门

export function delDepartment(id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}
